#ifndef _mcu_modbus_slaver_h
#define _mcu_modbus_slaver_h

#include "stdint.h"

class McuModbusSlaver {
protected:
    uint8_t	m_slaveAddr;
    uint8_t  m_reqBuffer[128];
    uint16_t m_reqBufferLen;
    uint8_t  m_resBuffer[160];
    uint16_t m_startAddress;
    uint16_t m_byteLen;
    uint8_t Fun06();
    uint8_t Fun16();
    uint8_t Fun03();
    uint8_t ReadOrWrite(int isRead, uint16_t ddaId, uint8_t* buf, uint16_t bufLen);
public:
    virtual ~McuModbusSlaver();
    uint16_t   Import(uint8_t* buf, uint16_t bufLen);
    McuModbusSlaver();
    virtual  void Exec();

};


#endif